package com.example.mydesignmodule.proxy;

import android.text.TextUtils;

/**
 * @author tgw
 * @date 2021/1/22
 *
 * 代理类 代理 ShowContent 隐藏了ShowContent的具体实现
 */
public class ProxyShowContent implements BaseProxy {

    private ShowContent showContent;
    private String proxyParam;

    public ProxyShowContent(String proxyParam) {
        this.proxyParam = proxyParam;
    }

    @Override
    public void showProxyContent() {
        System.out.println("代理的实现类 我在这里做了ShowContent的代理");
        if (proxyParam.equalsIgnoreCase("ShowContent")){
            if (showContent == null){
                showContent = new ShowContent("----静态代理具体做的事情----");
            }
            showContent.showProxyContent();
        }
    }
}
